<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <!-- 避免IE使用兼容模式 -->
    <meta http-equiv="X-UA-Compatible" content="IE=edge, chrome=1">
    <meta name="renderer" content="webkit">
    <link rel="stylesheet" type="text/css"
          href="<?php xcho(loadSource('/assets/plugins/bootstrap/css/bootstrap.min.css')) ?>">
    <link rel="stylesheet" href="<?php xcho(loadSource('/assets/plugins/animate.css/animate.css')) ?>">
    <link rel="stylesheet" href="<?php xcho(loadSource('/assets/plugins/font-awesome/css/font-awesome.css')) ?>">
    <link rel="stylesheet"
          href="<?php xcho(loadSource('/assets/plugins/data-table/media/css/dataTables.bootstrap.min.css')) ?>">
<!--    <link rel="stylesheet" href="--><?php //xcho(loadSource('/assets/plugins/ztree/css/zTreeStyle/zTreeStyle.css')) ?><!--">-->
    <link rel="stylesheet" href="<?php xcho(loadSource('/assets/plugins/layui/css/layui.css')) ?>" media="all">
    <link rel="stylesheet" href="<?php xcho(loadSource('/assets/plugins/ztree/css/zTreeStyle/zTreeStyle.css')) ?>">
    <link rel="stylesheet" href="<?php xcho(loadSource('/assets/plugins/ztree/css/metroStyle/metroStyle.css')) ?>" type="text/css">
    <link rel="stylesheet" href="<?php xcho(loadSource('/app/css/style.css')) ?>">
    <link rel="stylesheet" href="<?php xcho(loadSource('/app/css/app.css')) ?>">
    <link rel="stylesheet" href="<?php xcho(loadSource('/assets/css/new_main.css')) ?>">
</head>
<body><?php include_once TPL_PATH . 'public/nav.phtml'; ?>
    
    <div class="class-box">
        <div class="class-box-head ">
            <div class="class-box-title">
                <h3 class="col-md-11">
                    短信模板
                </h3>
                <div class="col-md-1">
                    <a href="<?php xcho(url('/sysmanager/sms/index')) ?>">返回列表</a>
                </div>
            </div>
        </div>
        <div class="class-box-body">
            <div class="form-horizontal">
                <div class="form-group">
                    <label class="col-sm-1 control-label" for="">主题</label>
                    <div class="col-sm-11">
                        <textarea name="title" rows="3" class="form-control"><?php xchoHtml($mouldDetail['title']) ?></textarea>
                    </div>
                </div>
                <div class="hr-line-dashed"></div>
                <div class="form-group">
                    <label class="col-sm-1 control-label" for="">内容</label>
                    <div class="col-sm-11">
                        <textarea name="message" rows="6" class="form-control"><?php xchoHtml($mouldDetail['message']) ?>
                        </textarea>
                    </div>
                </div>
            </div>
            
            <div class="btns-group">
                <button class="btn btn-primary">确定</button>
                <button class="btn btn-white"><a href="<?php xcho(url('/sysmanager/sms/index')) ?>">取消</a></button>
            </div>
        </div>
    </div>
    

<input type="hidden" name="editurl" value="<?php xcho($editurl) ?>" />
<input type="hidden" name="id" value="<?php xcho($id) ?>" />
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.8.0.js"></script>
<script>
    $(function () {

        $('.btn').click(function () {
           var title=$("textarea[name='title']").val();
           var message=$("textarea[name='message']").val();
           var id=$("input[name='id']").val();
           var url=$("input[name='editurl']").val();
           if(id==null||id==''){
               alert('请重新选择');
               return false;
           }
           if(title==null||title==''){
               alert('主题不能为空');
               return false;
           }
           if(message==null||message==''){
               alert('内容不能为空');
               return false;
           }
           $.ajax({
               url:url,
               type:'post',
               dataType:'json',
               data:{id:id,title:title,message:message},
               success:function (resp) {
                   if(resp.success==1){
                       alert('编辑成功');
                       location.href = "/sysmanager/sms/index";
                   }else {
                       alert('编辑失败');
                       location.href = "/sysmanager/sms/index";
                   }
               }
           });
        })
    })
</script>
    <?php include_once TPL_PATH . 'public/foot_script.phtml'; ?>

<button id="top" style="height: 50px;width: 50px;"></button></body>
</html>